#define _CTR_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include<stdlib.h>


struct stu
{
	char name[20];
	int age;
};

int cmp_by_name(const void* p1, const void* p2)
{
	return strcmp(((struct stu*)p1)->name, ((struct stu*)p2)->name);
}

int main()
{
	struct stu arr[] = {{"zhangsan",15},{"lisi",16},{"wangwu",18}};
	int sz = 0;
	sz = sizeof(arr) / sizeof(arr[0]);
	qsort(arr, sz , sizeof(arr[0]),cmp_by_name);

}